﻿<%@ WebHandler Language="C#" Class="FollowMaster" %>


using Activity;
using Activity.API;
using Ext.Net;

public class FollowMaster : BaseHandler
{
    /// <summary>
    /// 获取店铺信息
    /// </summary>
    /// <param name="shopNames"></param>
    public void GetShopList()
    {
        int customUserType = 0;
        string cType = _httpReuqest["userId"];
        int.TryParse(cType, out customUserType);
        var finishHandler = new FollowHandler();
        var list = finishHandler.GetShopList(customUserType);
        Success(list);
    }


    /// <summary>
    /// 获取问题跟进主单信息
    /// </summary>
    public void GetFollowMaster()
    {
        string shopCode = _httpReuqest["shopCode"];
        var finishHandler = new FollowHandler();
        var list = finishHandler.GetFollowMaster(shopCode);
        Success(list);
    }

    /// <summary>
    /// 增加问题跟进实体
    /// </summary>
    public void SavaFollow()
    {
        var followJson = _httpReuqest["follow"];
        FollowModelVO result = null;
        if (followJson != null)
        {
            var model = JSON.Deserialize<FollowModelVO>(followJson);
            var finishHandler = new FollowHandler();
            result = finishHandler.SavaFollow(model);
        }
        Success(result);
    }

    /// <summary>
    /// 获取问题跟进明细信息
    /// </summary>
    public void GetFollowDetail()
    {
        int tf_id = 0;
        int.TryParse(_httpReuqest["tf_id"], out tf_id);
        var finishHandler = new FollowHandler();
        var list = finishHandler.GetFollowDetail(tf_id);
        Success(list);
    }

    /// <summary>
    /// 获取图片
    /// </summary>
    public void GetInsImg()
    {
        int tid_id = 0;
        int.TryParse(_httpReuqest["tid_id"], out tid_id);
        var finishHandler = new FollowHandler();
        var list = finishHandler.GetInsImg(tid_id);
        Success(list);
    }

    public void RemoveDetail()
    {
        int tfd_id = 0;
        int.TryParse(_httpReuqest["tfd_id"], out tfd_id);
        var finishHandler = new FollowHandler();
        bool result = finishHandler.RemoveDetail(tfd_id);
        Success(result);
    }

    public void ExportFollowMaster()
    {
        string shopCode = _httpReuqest["shopCode"];
        var finishHandler = new FollowHandler();
        var result= finishHandler.ExportFollowMaster(shopCode);
        Success(result);
    }

}